SDK functions =============== This chapter explains the functions you can use when developing your own application or plugin. Below figure illustrates the project structure of ViCANdo: .. image:: _images/sdkfunctions/vicando_project_structure.jpg :scale: 70 % vxobject.h ----------------------- ================= VxObject ================= .. cpp:class:: VxObject : public QObject Constructs an object: .. cpp:function:: explicit VxObject() Increases the reference count of object: .. cpp:function:: void ref() Increase the reference count of object, and possibly remove the floating reference, if object has a floating reference: .. cpp:function:: void sinkRef() Decreases the reference count of object. When the reference count is 0, the object is finalized(i.e. its memory is freed): .. cpp:function:: void unref() Removes the floating reference of the object(Sets the floating state to false): .. cpp:function:: void sink() Checks whether object has a floating reference: .. cpp:function:: bool isFloating() Gets descriptive name that can be shown in the project explorer: .. cpp:function:: virtual const QString getObjectText() Returns the reference count of object: .. cpp:function:: int refCount() ==================== VxReference ==================== .. cpp:class:: template VxReference Constructs an object with no references: .. cpp:function:: VxReference() Constructs an object with reference copied from the input *_copy*: .. cpp:function:: VxReference(const VxReference& _copy) Constructs an object with an object pointer: .. cpp:function:: VxReference(T* _object_ptr) Destructor: .. cpp:function:: ~VxReference() Takes the reference count from the input *_object*: .. cpp:function:: void take(T* _object) Gets the current reference count of the object: .. cpp:function:: T* get() const The operator to get a member: .. cpp:function:: T* operator->() The operator to get the pointer of member: .. cpp:function:: const T* operator->() const The operator to get the pointer of a member: .. cpp:function:: operator T*() const The operator to get the address of the member: .. cpp:function:: T* operator&() const Equal operator: .. cpp:function:: VxReference& operator=(const VxReference& _copy) Equal operator: .. cpp:function:: VxReference& operator=(T* object_ptr) ==================== Other functions ==================== Returns the hash code of the VxReference object: .. cpp:function:: inline uint qHash(VxReference object) vxdata.h ----------------------- .. cpp:class:: VxData : public VxObject ========== =============== ===================== Property type READ accessor ========== =============== ===================== time qint64 getTimeStampInUs() data QVariantList getVariantData() ========== =============== ===================== Constructs a VxData object with argument timestamp in micro-seconds: .. cpp:function:: VxData(qint64 _time_stamp_in_us) Converts to QByteArray: .. cpp:function:: virtual QByteArray toByteArray() Returns true if objects are equal: .. cpp:function:: virtual bool equals(VxData* data) Converts QScriptEngine object to QScriptValue: .. cpp:function:: virtual QScriptValue toScriptValue(QScriptEngine* script_engine) Retrives the DataRowRenderer: .. cpp:function:: virtual VxDataRowRenderer* getDataRowRenderer() Returns the value of the property **time**: .. cpp:function:: qint64 getTimeStampInUs() Returns true if the object is statistic data: .. cpp:function:: bool isStatisticData() Returns the value of the property **data**: .. cpp:function:: QVariantList getVariantData() vxapprt.h ----------------------- This file contains macro definitions for the shared library vxtimer.h ----------------------- .. cpp:class:: VxTimer : public VxObject Constructs a VxTimer object: .. cpp:function:: VxTimer() Gets descriptive name that can be shown in the project explorer: .. cpp:function:: const QString getObjectText() Restarts the timer: .. cpp:function:: void restart() Sets the offset time in milli-seconds: .. cpp:function:: void setTimeOffsetInMs(qint64 time_in_ms) Sets the offset time in micro-seconds: .. cpp:function:: void setTimeOffsetInUs(qint64 time_in_us) Returns the elapsed time in milli-seconds: .. cpp:function:: qint64 elapsedInMs() Returns the elapsed time in micro-seconds: .. cpp:function:: qint64 elapsedInUs() Returns the current timestamp in milli-seconds: .. cpp:function:: static qint64 getCurrentTimeInMs() Returns the current timestamp in micro-seconds: .. cpp:function:: static qint64 getCurrentTimeInUs() vxcomponent.h ----------------------- .. cpp:class:: VxComponent : public VxObject ============== =============== ===================== Property type READ accessor ============== =============== ===================== dragEnabled int isDragEnabled() dropEnabled int isDropEnabled() ============== =============== ===================== Constructs a VxComponent object: .. cpp:function:: VxComponent() ========================== Public functions ========================== Get Icon to display: .. cpp:function:: virtual QIcon getIcon() Returns the number of the properties: .. cpp:function:: int getPropertyCount() Returns the property descriptor of the component based on the index: .. cpp:function:: VxReference getPropertyDescriptor(int index) Sets the component object ID, this method should only be called once: .. cpp:function:: void setObjectID(const quint64& _object_id) Retrieves the component object ID. This method may not be invoked before setObjectID has been invoked: .. cpp:function:: quint64 getObjectID() Returns true if object ID is already set by setObjectID(): .. cpp:function:: bool isObjectIDSet() Actions to display in context menu for component: .. cpp:function:: virtual QList actions(QWidget* parent) Register source to the script engine. Returns the object that will be registered to the script engine: .. cpp:function:: virtual QScriptValue registerToScriptEngine(QScriptEngine* _script_engine) Drag and Drop. Returns true if drag is enabled for this component: .. cpp:function:: bool isDragEnabled() Drag and Drop. Returns true if drop is enabled for this component: .. cpp:function:: bool isDropEnabled() Returns true if the *mime_data* can be handled by the model, otherwise returns false: .. cpp:function:: virtual bool dropMimeData(VxProject* project, const VxComponentMimeData* mime_data, int index) ========================== Signals ========================== New message to display on the console: .. cpp:function:: void newLogMessage(const QString& message) Information for the object is updated: .. cpp:function:: void update(VxObject* _this) Emitted when a property for this has changed: .. cpp:function:: void propertyChanged(const QString& property_name) Emitted if user wants to delete this compoent: .. cpp:function:: void deleteComponent(VxComponent* _this) Emitted when all properties in projects need to be refreshed: .. cpp:function:: void refreshAllProperties() ========================== Public slots ========================== Write a new message to the console windows: .. cpp:function:: void logMessage(const QString& message) Deletes the component: .. cpp:function:: void deleteComponentAction() ========================== Protected functions ========================== Invoked when user request this component to be deleted. Optionally implemented by subclasses to add some special handling to this event: .. cpp:function:: virtual void componentDeleteRequest() Add a new property descriptor to the list: .. cpp:function:: void addProperty(VxPropertyDescriptor* property_descriptor) Remove the component property: .. cpp:function:: void removeComponentProperty(const QString& property_name) Reference to the script engine used by the project. Returns 0 before registerToScriptEngine has been invoked: .. cpp:function:: QScriptEngine* scriptEngine() Every component has an *object ID* that is unique within the project: .. cpp:member:: quint64 object_id Enable/Disable drag for this component: .. cpp:function:: void setDragEnabled(bool enabled) Enable/Disable drop for this component: .. cpp:function:: void setDropEnabled(bool enabled) ========================== Other functions ========================== Returns the hash code of the object: .. cpp:function:: inline uint qHash(VxReference component) vxappqmlapplicationengine.h ------------------------------------- ===================================== Main function ===================================== The main function of the application. You can specify the arguments, application icon file and your own application engine object: .. cpp:function:: int vxAPP_main(int argc, char *argv[], const QString& app_icon, const QMetaObject* app_engine_class) ===================================== VxAppQmlApplicationEngine ===================================== To be able to understand below functions, you need to have basic knowledge of QML/C++ hybrid programming skills. Below links from Qt provide useful information for you to get started. You can also refer to the simple J1939 demo application source code to learn how to setup your own QML application on top of the ViCANdo project. * `Qt QML `_ * `Important C++ Classes Provided By The Qt QML Module `_ * `Integrating QML and C++ `_ VxAppQmlApplicationEngine class provides a convenient way to load an application from the single qml file: .. cpp:class:: VxAppQmlApplicationEngine : public QQmlApplicationEngine Parameterized Constructor. Parameter *_app_name* is your application's name. Parameter *_project_path* is the path of the *ViCANdo.project* file inside your Qt application: .. cpp:function:: VxAppQmlApplicationEngine(const QString& _app_name, const QString& _project_path) Class destructor: .. cpp:function:: ~VxAppQmlApplicationEngine() Virtual initialization function. You need to implement your own init() function: .. cpp:function:: virtual void init() Virtual postInit() function. To be executed after init() was called: .. cpp:function:: virtual void postInit() Checks the ViCANdo SDK license status of the connected USB-CAN interface. Return false if the license is invalid: .. cpp:function:: bool checkLicense() Updates the list of the available CAN channels: .. cpp:function:: void updateCANChannelList() Returns the pointer of the QML component object: .. cpp:function:: QQmlComponent* getQMLComponent() Sets the project recording_directory path: .. cpp:function:: void setProjectRecordingDirectory(const QString& recording_directory_path) Finds the object in the project by the object name which can be set in the **Component properties** window of the sources in ViCANdo. Returns the pointer of the object: .. cpp:function:: QObject *findProjectObject(const QString& component_name) vxproject.h ------------------------------------- VxProject class is the base class of the ViCANdo project. From this class you will have access to the properties and configuration of the project. .. cpp:class:: VxProject : public VxComponent ==================================== =============== ===================== Property type READ accessor ==================================== =============== ===================== projectName QString getProjectName() preTriggerTimeInMs int getPreTriggerTime() limitRecordTime bool getLimitRecordTime() returnToArmedAfterTrigger bool getReturnToArmedAfterTrigger() maxRecordingTimeInS int getMaxRecordingTime() maxRecordingTimeInSVisible bool getLimitRecordTime(). True if *limit record time* is checked continueRecordInANewSession bool getContinueRecordInANewSession() continueRecordInANewSessionVisible bool getLimitRecordTime(). True if *limit record time* is checked ==================================== =============== ===================== ========================== Public functions ========================== Class constructor: .. cpp:function:: VxProject(const QString& name, const QString& directory) **Arguments:** * **name** is the name of the project. * **directory** is the folder directory of the project. Open project dialog: .. cpp:function:: static QString openProjectDialog(QWidget* parent = 0) Open project: .. cpp:function:: static VxReference openProject(const QString& project_path, QWidget* parent = 0) **Arguments:** * **project_path** is the absolute path of the project. Save project: .. cpp:function:: void saveProject() Load project: .. cpp:function:: bool loadProject() Save project as: .. cpp:function:: void saveProjectAs(QWidget* parent) Get next object ID: .. cpp:function:: quint64 nextObjectID() ==================== State ==================== Enumerator **State** provides all kinds of states the project can have, corresponding with the menus in the software. Idle state is when a project is opened but no action were taken. .. cpp:enumerator:: State::Idle .. cpp:enumerator:: State::WaitingForPrepare .. cpp:enumerator:: State::Prepare Recording state is when the record button is clicked. ViCANdo starts to record the data. .. cpp:enumerator:: State::Recording Playing state is when a session is selected to playback. .. cpp:enumerator:: State::Playing Pause state is when pause menu is clicked. .. cpp:enumerator:: State::Pause .. cpp:enumerator:: State::RewindingBeforePlayback ==================== TriggerAction ==================== Enumerator **TriggerAction** provides the default actions for a trigger. This action will start recording when the trigger is trigged: .. cpp:enumerator:: TriggerAction::StartRecordAction This action will stop recording when the trigger is trigged: .. cpp:enumerator:: TriggerAction::StopRecordAction This action will insert a log marker when the trigger is trigged: .. cpp:enumerator:: TriggerAction::LogMarkerAction This action will set a bookmark when the trigger is trigged: .. cpp:enumerator:: TriggerAction::SetBookmarkAction .. cpp:function:: const QString getObjectText() .. cpp:function:: QList actions(QWidget* parent) .. cpp:function:: bool isReadOnlyResource() .. cpp:function:: const QString& getDirectory() .. cpp:function:: const QString& getRecordDirectory() .. cpp:function:: void setProjectRecordDirectory(const QString& _project_record_directory) .. cpp:function:: const QString& getApplicationDirectory() .. cpp:function:: void setApplicationDirectory(const QString& app_dir) .. cpp:function:: QList > getDataSourceList() .. cpp:function:: QList > getSlaveSourceList() .. cpp:function:: QList > getSourceList() .. cpp:function:: int getDataSourceCount() .. cpp:function:: QList > getPresenterList() .. cpp:function:: QList > getTriggerList() .. cpp:function:: QList > getScriptletList() .. cpp:function:: QList > getDBCList() .. cpp:function:: VxReference getDBCComponentById(quint64 component_id) .. cpp:function:: VxReference getDBCComponentByName(const QString& name) .. cpp:function:: VxReference getDBCComponentByFilePath(const QString& file_path) .. cpp:function:: VxReference getScriptletByName(const QString& name) .. cpp:function:: QStringList getTriggerActionTextList() .. cpp:function:: const QString getProjectName() .. cpp:function:: void setProjectName(const QString _project_name) .. cpp:function:: int getPreTriggerTime() .. cpp:function:: void setPreTriggerTime(int pre_trigger_time_in_ms) .. cpp:function:: qint64 getRecordTimerStartOffsetInUs() .. cpp:function:: bool getReturnToArmedAfterTrigger() .. cpp:function:: void setReturnToArmedAfterTrigger(bool v) .. cpp:function:: bool getLimitRecordTime() .. cpp:function:: void setLimitRecordTime(bool v) .. cpp:function:: void resetRecordTimer() .. cpp:function:: int getMaxRecordingTime() .. cpp:function:: void setMaxRecordingTime(int max_recording_time_in_s) .. cpp:function:: bool getContinueRecordInANewSession() .. cpp:function:: void setContinueRecordInANewSession(bool v) .. cpp:function:: QList > getDataSourceListMatchingType(const QMetaObject* meta_object) .. cpp:function:: QList > getDataSourceListMatchingType(const char* class_name) template .. cpp:function:: QList > getDataSourceListMatchingType() template .. cpp:function:: QList > getPresenterListMatchingType() template .. cpp:function:: QList > getPresenterListMatchingType(const QString& type_name) template .. cpp:function:: QList > getPresenterListMatchingInterface() .. cpp:function:: QList > getAllSessionList() .. cpp:function:: QList > getTopLevelSessionGroupList() .. cpp:function:: VxReference getAllSessionsGroup() .. cpp:function:: VxReference getSessionByID(quint64 object_id) .. cpp:function:: void addNewSession(VxReference session) .. cpp:function:: void addNewSessionGroup(VxReference session_group, VxSessionGroup* parent_session_group = 0) .. cpp:function:: int addSessionGroup(VxReference session_group, VxSessionGroup* parent_session_group) .. cpp:function:: void enumerateSessionGroups(const QString& name) .. cpp:function:: State getCurrentState() .. cpp:function:: VxSession* getCurrentSession() .. cpp:function:: VxScriptEngine* getScriptEngine() .. cpp:function:: VxReference getMarkerList() .. cpp:function:: VxReference getDataSourceMatching(quint64 source_id) .. cpp:function:: VxReference getSourceMatching(quint64 source_id) .. cpp:function:: VxReference getPresenterMatching(quint64 source_id) .. cpp:function:: VxReference getLogDataFileMatching(quint64 log_data_file_id) .. cpp:function:: void addDataSource(VxDataSource* source) .. cpp:function:: void addSlaveSource(VxSlaveSource* source) .. cpp:function:: void addPresenter(VxPresenter* presenter) .. cpp:function:: void addTrigger(VxTrigger* trigger) .. cpp:function:: void addScriptlet(VxScriptletComponent* scriptlet) .. cpp:function:: void addDBC(VxDBCComponent* dbc_component) .. cpp:function:: bool prepareSession() .. cpp:function:: bool startRecord() .. cpp:function:: bool breakRecord(bool create_new_session) .. cpp:function:: bool playSession(VxSession* session) .. cpp:function:: bool seekToPositionForSession(VxSession* session, qint64 position_in_time) .. cpp:function:: bool pause() .. cpp:function:: bool resume() .. cpp:function:: void stop(bool called_from_scriplet = false) .. cpp:function:: void shutdown(bool called_from_scriplet = false) .. cpp:function:: VxDataSource::PlaybackMode getPlaybackMode() .. cpp:function:: void setPlaybackMode(VxDataSource::PlaybackMode _playback_mode) .. cpp:function:: void selectData(VxSource* source, VxData* data) .. cpp:function:: QIcon getIcon() .. cpp:function:: void clearAppicationSettings() .. cpp:function:: void addApplicationSetting(const QString& key, const QByteArray value) .. cpp:function:: QByteArray getApplicationSetting(const QString& key) .. cpp:function:: bool hasApplicationSettingKey(const QString& key) .. cpp:function:: void emitNewSearchMatch(VxSession* session, VxDataSource* source, qint64 time_pos, const QString data_content_text) .. cpp:function:: void emitSessionRangeChanged(VxSession* session) .. cpp:function:: VxReference getSlaveSourceFor(VxComponent* originator, VxSource* master_source, const QString& key, qint64 object_id = -1) .. cpp:function:: void invalidateSlaveSourcesFor(VxComponent* originator) .. cpp:function:: void removeInvalidSlaveSources() .. cpp:function:: VxReference getOriginatorFor(VxReference slave_source) .. cpp:function:: void detachSlaveSource(VxPresenter* from_presenter, VxSlaveSource* slave_source) .. cpp:function:: void detachTrigger(VxTrigger* trigger) .. cpp:function:: VxProjectQMLProxy* getQMLProxy() .. cpp:function:: void emitClearConsoleSignal() .. cpp:function:: void removeDataSource(VxDataSource* data_source) .. cpp:function:: void removeComponentFromProject(VxComponent* component) .. cpp:function:: void storeScriptValue(const QString& key, const QString& value) .. cpp:function:: QString readStoredScriptValue(const QString& key) .. cpp:function:: void removeStoredScriptValue(const QString& key) .. cpp:function:: bool hasStoredScriptValue(const QString key) .. cpp:function:: void clearStoredScriptValues() .. cpp:function:: VxReference getRecordTimer() .. cpp:function:: VxReference getPlaybackTimer() .. cpp:function:: float getPlaybackFactor() .. cpp:function:: void selectPresenter(VxPresenter* presenter) .. cpp:function:: QString getRecordStartStopReason() .. cpp:function:: QList > getRecordSessionBookmarkList() ========== Signals ========== .. cpp:function:: void newSourceAdded(VxSource* source) .. cpp:function:: void newPresenterAdded(VxPresenter* presenter) .. cpp:function:: void newSessionGroupAdded(VxSessionGroup* session_group, int index) .. cpp:function:: void newTriggerAdded(VxTrigger* data_trigger) .. cpp:function:: void newScriptletAdded(VxScriptletComponent* scriptlet) .. cpp:function:: void newDBCAdded(VxDBCComponent* dbc) .. cpp:function:: void currentSessionChanged(VxSession* session) .. cpp:function:: void componentRemoved(VxComponent* component) .. cpp:function:: void stateChanged(VxProject::State prev_state, VxProject::State new_state) .. cpp:function:: void playTimeUpdated(qint64 elapsed_time_in_us, qint64 end_time_in_us) .. cpp:function:: void startSeek() .. cpp:function:: void seekDone() .. cpp:function:: void dataSelected(VxSource* source, VxData* data) .. cpp:function:: void clearSelection() .. cpp:function:: void clearSearchResults() .. cpp:function:: void searchDone() .. cpp:function:: void newSearchMatch(VxSession* session, VxDataSource* source, qint64 time_pos, const QString& data_content_text) .. cpp:function:: void clearConsole() .. cpp:function:: void playbackFinished() .. cpp:function:: void playbackModeChanged(VxDataSource::PlaybackMode playback_mode) .. cpp:function:: void sessionRangeChanged(VxSession* session) .. cpp:function:: void updateSession(VxSession* session) .. cpp:function:: void projectNameChanged() .. cpp:function:: void objectSelected(VxObject* object) .. cpp:function:: void recordBreak(qint64 break_time_in_us) ============== Public slots ============== .. cpp:function:: void setPlaybackSpeedFactor(float factor) .. cpp:function:: void updatePlaytime() .. cpp:function:: void openSearchDialog(VxSessionGroup* session_group, VxSession* session) .. cpp:function:: void setHighlightedText(const QString& text, Qt::CaseSensitivity case_sensitivity = Qt::CaseInsensitive) .. cpp:function:: void clearPresenterViews() .. cpp:function:: void startBacktraceUpdate() .. cpp:function:: void stopBacktraceThread() .. cpp:function:: void restartScriptEngine() .. cpp:function:: void mark(const QString& marker_id) vxsource.h ------------------------------------- TODO vxpresenter.h ------------------------------------- TODO vxqueue.h ------------------------------------- TODO vxtimebase.h ------------------------------------- TODO vxcanflags.h ------------------------------------- A class contains all the CAN related enumerations. .. cpp:class:: VxCANFlags .. _reference-label-messageflagmask: ==================== MessageFlagsMask ==================== MessageFlagsMask provides the message flags. All flags and/or combinations of them are meaningful for both transmitted and received CAN messages: .. cpp:enumerator:: MessageFlagsMask::Rtr = 0x00001 .. cpp:enumerator:: MessageFlagsMask::Standard = 0x00002 .. cpp:enumerator:: MessageFlagsMask::Extended = 0x00004 .. cpp:enumerator:: MessageFlagsMask::Wakeup = 0x00008 .. cpp:enumerator:: MessageFlagsMask::NError = 0x00010 .. cpp:enumerator:: MessageFlagsMask::ErrorFrame = 0x00020 .. cpp:enumerator:: MessageFlagsMask::TxMsgAcknowledge = 0x00040 .. cpp:enumerator:: MessageFlagsMask::TxMsgRequest = 0x00080 .. cpp:enumerator:: MessageFlagsMask::ErrorMask = 0x0ff00 .. cpp:enumerator:: MessageFlagsMask::ErrorHWOverrun = 0x00200 .. cpp:enumerator:: MessageFlagsMask::ErrorSWOverrun = 0x00400 .. cpp:enumerator:: MessageFlagsMask::ErrorStuff = 0x00800 .. cpp:enumerator:: MessageFlagsMask::ErrorForm = 0x01000 .. cpp:enumerator:: MessageFlagsMask::ErrorCRC = 0x02000 .. cpp:enumerator:: MessageFlagsMask::ErrorBIT0 = 0x04000 .. cpp:enumerator:: MessageFlagsMask::ErrorBIT1 = 0x08000 .. cpp:enumerator:: MessageFlagsMask::InternalFrame = 0x10000 .. cpp:enumerator:: MessageFlagsMask::ISO15765ExtAddr = 0x20000 .. cpp:enumerator:: MessageFlagsMask::ISO15765UnknownType = 0x40000 .. _reference-label-capabilitemask: ==================== CapabilitesMask ==================== CapabilitesMask provides additional function masks for the messages. It specifies the type of the message: .. cpp:enumerator:: CapabilitesMask::ExtendedCAN = 0x00000001L .. cpp:enumerator:: CapabilitesMask::BusStatistics = 0x00000002L .. cpp:enumerator:: CapabilitesMask::ErrorCounters = 0x00000004L .. cpp:enumerator:: CapabilitesMask::CanDiagnostics = 0x00000008L .. cpp:enumerator:: CapabilitesMask::GenerateError = 0x00000010L .. cpp:enumerator:: CapabilitesMask::GenerateOverload = 0x00000020L .. cpp:enumerator:: CapabilitesMask::TxRequest = 0x00000040L .. cpp:enumerator:: CapabilitesMask::TxAcknowledge = 0x00000080L .. cpp:enumerator:: CapabilitesMask::Virtual = 0x00010000L .. cpp:enumerator:: CapabilitesMask::Simulated = 0x00020000L .. cpp:enumerator:: CapabilitesMask::Remote = 0x00040000L ==================== DriverMode ==================== DriverMode provides the general CAN bus driver mode. .. cpp:enumerator:: DriverMode::Off = 0 .. cpp:enumerator:: DriverMode::Silent = 1 .. cpp:enumerator:: DriverMode::Normal = 4 .. cpp:enumerator:: DriverMode::SelfReception = 8 .. _reference-label-readresult: ==================== ReadResult ==================== ReadResult provides the status code for the function that reads the CAN message: .. cpp:enumerator:: ReadResult::ReadStatusOK = 0 .. cpp:enumerator:: ReadResult::ReadTimeout = -1 .. cpp:enumerator:: ReadResult::ReadError = -2 .. _reference-label-sendresult: ==================== SendResult ==================== SendResult provides the status code for the function that transmits the CAN message: .. cpp:enumerator:: SendResult::SendStatusOK = 0 .. cpp:enumerator:: SendResult::SendTimeout = -1 .. cpp:enumerator:: SendResult::TransmitBufferOveflow = -2 .. cpp:enumerator:: SendResult::SendInvalidParam = -3 .. cpp:enumerator:: SendResult::SendError = -4 vxcaninterface.h ------------------------------------- An interface class that describles general functions needed for supported CAN interfaces: .. cpp:class:: VxCANInterface : public VxCANFlags Class constructor: .. cpp:function:: VxCANInterface() Returns the capabilite of the message. The return value can be one or combined :ref:`reference-label-capabilitemask`. .. cpp:function:: virtual quint32 canGetCapabilites() Reads a CAN message from the receive buffer of the CAN interface: .. cpp:function:: virtual ReadResult canRead(long& id, QByteArray& data, unsigned int& flag, qint64& timestmap_in_us, int timeout_in_ms) **Arguments:** * **id** is the CAN message identifier. * **data** is the data field of the CAN message. * **flag** is one or combined :ref:`reference-label-messageflagmask`. * **timestmap_in_us** is the timestamp of the message in micro-seconds. * **timeout_in_ms** is the maximum time in milli-seconds to read the message. If no message is read when time reachs timeout_in_ms, *ReadResult::ReadTimeout* will be returned. **Returns:** One of the :ref:`reference-label-readresult`. Sends a CAN message from the CAN interface: .. cpp:function:: virtual SendResult canSend(const long id, const QByteArray& data, const unsigned int flag, int timeout_in_ms) **Arguments:** * **id** is the CAN message identifier. * **data** is the data field of the CAN message. * **flag** is one or combined :ref:`reference-label-messageflagmask`. * **timeout_in_ms** is the maximum time in milli-seconds to send the message. If no message is sent when time reachs timeout_in_ms, *SendResult::SendTimeout* will be returned. **Returns:** One of the :ref:`reference-label-sendresult`. vxplugindescriptor.h ------------------------------------- .. cpp:class:: VxPluginDescriptor : public QObject Class constructor: .. cpp:function:: VxPluginDescriptor(const QString& _name, const QString& _description) **Arguments:** * **_name** is the name of the plugin. * **_description** is the description of the plugin. Returns the name of the plugin: .. cpp:function:: const QString& getName() Returns the description of the plugin: .. cpp:function:: const QString& getDescription() Register as the global resources: .. cpp:function:: virtual void registerGlobalResources() vxvideo.h ------------------------------------- This file contains macro definitions for the video module. vxvideoframedata.h ------------------------------------- `Open CV `_ , the open source computer vision and machine learning software library was used in ViCANdo SDK. This class provides the functions for processing video frame data. .. cpp:class:: VxVideoFrameData : public VxData Class constructor: .. cpp:function:: VxVideoFrameData(int _frame_number, qint64 _time_stamp) **Arguments:** * **_frame_number** is the number of the video frame. * **_time_stamp** is the timestamp of the video frame. Returns the IplImage format of the video frame. Read more about **IplImage** from this `link `_ .. cpp:function:: virtual IplImage* getIplImage() Returns Scriptvalue of the script engine: .. cpp:function:: QScriptValue toScriptValue(QScriptEngine* script_engine) Converts the video frame to QImage: .. cpp:function:: QImage toQImage() Returns the frame number: .. cpp:function:: int getFrameNumber() const Returns the maximum length of the time format. The time format is **00:00:00.000**, with a length of 12. .. cpp:function:: static int getTimeFormatMaxLength() Returns the application timer format: .. cpp:function:: QString getApplicationTimerFormat() Returns the format of the frame count: .. cpp:function:: QString getFrameCountFormat() Returns true if two VxData objects are the same: .. cpp:function:: bool equals(VxData* data) vximageprocessor.h ------------------------------------- .. cpp:class:: VxImageProcessor : public VxObject ======================== Nested class: Object ======================== .. cpp:class:: Object Members: .. cpp:member:: QPen pen .. cpp:member:: QPolygon polygon .. cpp:member:: QString info .. cpp:member:: QPoint info_pos Resizes the polygon: .. cpp:function:: QPolygon scale(const QSize& from_size, const QSize& to_size) **Arguments:** * **from_size** is the original size of the polygon. * **to_size** is the destination size you want to resize to. Resizes the point: .. cpp:function:: QPoint scaleInfoPos(const QSize& from_size, const QSize& to_size) **Arguments:** * **from_size** is the original size of the point. * **to_size** is the destination size you want to resize to. ========================== Public functions ========================== Class constructor: .. cpp:function:: VxImageProcessor() Processes the input video frame data: .. cpp:function:: virtual void processVideoFrameData(VxReference _video_frame_data) ============= Signals ============= Updates the object list: .. cpp:function:: void updateObjectList(const QString& key, QList object_list) **Arguments:** * **key** is the key of the object list to be updated. * **object_list** is the object list to be updated. vximageprocessordescriptor.h ------------------------------------- .. cpp:class:: VxImageProcessorDescriptor : public VxPluginDescriptor Class constructor: .. cpp:function:: VxImageProcessorDescriptor(const QString& _name, const QString& _description) **Arguments:** * **_name** is the name of the image processor. * **_description** is the description of the image processor. Class destructor: .. cpp:function:: ~VxImageProcessorDescriptor() Creates a VxImageProcessor object for the input VxProject object: .. cpp:function:: virtual VxImageProcessor* create(VxProject* project) Loads the VxImageProcessor object: .. cpp:function:: virtual VxImageProcessor* load(VxProject* project, QDomElement& source_root) **Arguments:** * **project** is the pointer of the VxProject object. * **source_root** is the address of the element in the DOM tree. vximagemathutils.h ------------------------------------- This file contains the utility classes of the image math calculations. ===================== VxExpMovingAverage ===================== A class handles the `exponential moving average(EMA) `_ .. cpp:class:: VxExpMovingAverage Class constructor: .. cpp:function:: VxExpMovingAverage() Clears current EMA: .. cpp:function:: void clear() Adds value to current EMA: .. cpp:function:: void add(double value) Gets the current EMA: .. cpp:function:: double get() =============== VxImageMath =============== .. cpp:class:: VxImageMath Returns the subtraction of two 2D 32-bit floating points: .. cpp:function:: static CvPoint2D32f sub(CvPoint2D32f b, CvPoint2D32f a) Returns the multiplication of two 2D 32-bit floating points: .. cpp:function:: static CvPoint2D32f mul(CvPoint2D32f b, CvPoint2D32f a) Returns the addition of two 2D 32-bit floating points: .. cpp:function:: static CvPoint2D32f add(CvPoint2D32f b, CvPoint2D32f a) Multiplies a point by a scalar: .. cpp:function:: static CvPoint2D32f mul(CvPoint2D32f b, float t) **Arguments:** * **b** is the 2D point. * **t** is the scalar. Returns the Dot Product of two points: .. cpp:function:: static float dot(CvPoint2D32f a, CvPoint2D32f b) Returns the distance of the point v: .. cpp:function:: static float dist(CvPoint2D32f v) Gets the closest point on segment: .. cpp:function:: static CvPoint2D32f pointOnSegment(CvPoint2D32f line0, CvPoint2D32f line1, CvPoint2D32f pt) **Arguments:** * **line0** is one end point coordinate of the segment. * **line1** is the other end point coordinate of the segment. * **pt** is any point on the segment. Returns the perpendicular distance between point and line: .. cpp:function:: static float dist2line(CvPoint2D32f line0, CvPoint2D32f line1, CvPoint2D32f pt) **Arguments:** * **line0** is one end point coordinate of the line. * **line1** is the other end point coordinate of the line. * **pt** is the point.